import { dayjs } from "element-plus";

export const CommonEchartLegend = {
  icon: "rect",
  itemWidth: 10,
  textStyle: {
    color: "#fff",
  },
  itemHeight: 10,
};
export function getNumberToPercent(number) {
  return number ? Number(Number(number * 100).toFixed(2)) : 0;
}
export const parseTime1 = (time, format = "YYYY-MM-DD HH:mm:ss") => {
  if (isNaN(time * 1)) {
    return time ? dayjs(new Date(time)).format(format) : "";
  } else {
    return time ? dayjs(time * 1).format(format) : "";
  }
};
